﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Security"
    targetNamespace="http://OCXS.org/Security"
    elementFormDefault="qualified"
    xmlns="http://OCXS.org/Security"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>

  <!-- Elements definition -->
  <!-- Configuration is the root element in the configuration hierarchy -->
  <xs:element name="Security" type="SecurityType"/>

  <!-- Types definition -->
  <!-- Root -->
  <xs:complexType name="SecurityType">
    <xs:sequence>
      <xs:element name="Users" type="UsersType"/>
    </xs:sequence>
  </xs:complexType>
  
  <!-- Users -->
  <xs:complexType name="UsersType">
    <xs:sequence>
      <xs:element name="User" type="UserType" minOccurs="1" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
  
  <!-- User type -->
  <xs:complexType name="UserType">
    <xs:sequence>
      <xs:element name="Username" type="UsernameType"/>
      <xs:element name="Password" type="PasswordType"/>
    </xs:sequence>
  </xs:complexType>

  <!-- Username -->
  <xs:simpleType name="UsernameType">
    <xs:restriction base="xs:string">
      <xs:pattern value="\w*"/>
    </xs:restriction>
  </xs:simpleType>

  <!-- Password -->
  <xs:simpleType name="PasswordType">
    <xs:restriction base="xs:string">
      <xs:pattern value="\w*"/>
    </xs:restriction>
  </xs:simpleType>
  
</xs:schema>
